<template>
  <div class="audit-root-list-item yj">
    <el-row>
      <el-col class="divlist-item-2em" :span="5" title="设备名称">{{data.deviceName}}</el-col>
      <el-col class="divlist-item-2em" :span="5" title="设备地址">{{data.ip}}</el-col>
      <el-col class="divlist-item-2em" :span="5" title="操作用户名称">{{data.username}}</el-col>
      <el-col class="divlist-item-2em" :span="5" title="操作时间">{{data.ctime}}</el-col>
      <el-col v-show="config.rights.browser_audit_video_manger" class="divlist-item-2em" :span="4">
        <el-button @click="onVideo" title="查看录像" size="mini" icon="el-icon-video-camera" circle></el-button>
        <el-button @click="onDel" title="删除录像" size="mini" type="danger" icon="el-icon-delete" circle></el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: "AuditVideoItem",
  props: ["data", "onDelP"],
  data() {
    return {
      videoDialog: {
        visible: false,
      },
    };
  },
  methods: {
    onVideo() {
      this.utils.emit("event_audit_video_open", {
        id: this.data.uuid,
      });
    },
    onDel() {
      this.$confirm("将永久删除该录像, 是否继续?", "删除提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.utils.http(
            "post",
            "/webapi/auditvideo/video/del",
            { id: this.data.id },
            () => {
              this.onDelP(this.data.id);
            }
          );
        })
        .catch(() => {});
    },
  },
  mounted() {},
  destroyed() {},
};
</script>

<style>
.audit-root-list-item {
  padding: 10px;
  background-color: #ffffff;
  font-size: 14px;
  color: #606266;
  margin-bottom: 5px;
}
</style>